package com.ych.redis.config;

/**
 * Created with IntelliJ IDEA.
 * Author: Usopp.tsui
 * Date: 2020/12/5
 * Time: 15:02
 * Description:
 */
public class RedisKeyConfig {
    //sessionId.token过期时间: 90天
    public static final long expireTime = 3600 * 24 * 15L;

    //redis分布式锁常规锁时间 2分钟
    public static final long leaseTime = 120L;

    //注册短信验证码
    public static final String msgCode = "msg:register:code:";


    //用户邀请码
    public static final String invitationCode = "invitation:code:";

    //用户注册锁
    public static final String registerCode = "register:code:";

    //抽奖券分发
    public static String rewardRaffleTicket = "reward:raffle:ticket:";

    //登录验证码图片
    public static       String captchaKey   = "captcha:key:";

    //文件token
    public static final String fileTokenKey = "fileTokenKey:";

    public static final String sessionToken = "sessionToken:";

    public static String sessionToken(String userId) {
        return sessionToken + userId;
    }

    //ip频率请求频率控制
    public static final String requestLimit = "requestLimit:";

    public static String requestLimit(String ip) {
        return requestLimit + ip;
    }
}
